<?php
    class Admin_Model_Place extends Zendvn_Model_Nested
    {
        protected $_name = 'place';
        protected $_primary = 'place_id';
        protected $_db;
        
        public function __construct(){
            $this->_db = Zend_Registry::get('db');
        }
        
        public function listPlace(){
			$sql = $this->_db->select()
							 ->from($this->_name)
							 ->order('lft ASC');
			$query = $this->_db->fetchAll($sql);
			return $query;
		}
        
        public function getPlaceNameById($id){
            
            $sql=$this->_db->select('place_name')
                            ->from($this->_name)
                            ->where("place_id=$id");
            $query=$this->_db->fetchRow($sql);
            return $query['place_name'];
        }
    }
